//
//  Rrcorder.h
//  Recorder
//
//  Created by hetao on 14-7-29.
//  Copyright (c) 2014年 hetao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

@interface Rrcorder : NSObject<AVAudioRecorderDelegate,AVAudioSessionDelegate,AVAudioPlayerDelegate>
{
    AVAudioRecorder *recorder;
    AVAudioPlayer *audplayer;
    AVAudioSession *audsession;
    NSURL* tmpFile;//保存声音地址
    NSTimer  *timer;
    UIView *view;//声音提示视图
    UIImageView *tsimage;//提示图片
    
}
@property (nonatomic,assign)BOOL isplay;//yes==以录音

+ (id)defule;
///开始录音
- (void)recorderStater;

///停止录音 返回字典，time:录音时长  data:录音数据
- (NSDictionary *)recorderStop;

///播放录音  data:可以为NSData==声音数据 或 NSString==声音路径
- (void)recorderplayerData:(id)data;

///停止播放
- (void)stoprecorder;

///获取音频文件声音时长
- (NSString *)recorederTime:(NSData *)data;

///保存录音文件 
- (NSString *)saveAudioName:(NSString *)name data:(NSData *)data;

///下载录音文件
- (NSData *)doloadAudioUrl:(NSString *)url FileName:(NSString *)name;

@end

